package com.steak.concurrent.threadType.daemon;

import lombok.SneakyThrows;

import java.util.concurrent.LinkedBlockingQueue;

/**
 * 功能说明：
 * <p>
 * Original @Author: steakliu-刘牌, 2022-09-05  10:11
 * <p>
 * Copyright (C)2020-2022  steakliu All rights reserved.
 */
public class JobThread extends Thread{

    public static final LinkedBlockingQueue<Object> linkedBlockingQueue = new LinkedBlockingQueue<>();

    @SneakyThrows
    @Override
    public void run() {
        while (true){
            System.out.println("take element : "+linkedBlockingQueue.take());
        }
    }

    public static void put(Object o) throws InterruptedException {
        linkedBlockingQueue.put(o);
    }
}
